
// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
  "nickname": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "昵称"
  },
  "city": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "城市"
  },
  "sex": {
    "rules": [
      {
        "format": "string"
      },
      {
        "range": [
          {
            "value": 1,
            "text": "男"
          },
          {
            "value": 2,
            "text": "女"
          }
        ]
      }
    ],
    "label": "性别"
  },
  "headimgurl": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "头像"
  },
  "dianliang": {
    "rules": [
      {
        "format": "number"
      }
    ],
    "label": "点亮"
  },
  "status": {
    "rules": [
      {
        "format": "number"
      },
      {
        "range": [
          {
            "value": 0,
            "text": "否"
          },
          {
            "value": 1,
            "text": "是"
          }
        ]
      }
    ],
    "label": "是否点亮过"
  },
  "num": {
    "rules": [
      {
        "format": "number"
      }
    ],
    "label": "第几个点亮的"
  }
}

const enumConverter = {
  "sex_valuetotext": {
    "1": "男",
    "2": "女"
  },
  "status_valuetotext": [
    {
      "value": 0,
      "text": "否"
    },
    {
      "value": 1,
      "text": "是"
    }
  ]
}

export { validator, enumConverter }
